#include <iostream>
#include <winsock2.h>
#include <mysql.h>
#include <string>
#include "DATABASE.h"
using namespace std;

int main()
{
    string name, address, job, iyoga, commend, type;

    DATABASE db;
    //db.ShowTable();
    while (cin >> iyoga >> commend) {
        string sqlInput;
        if (!commend.compare("add-member")) {
            cin >> name >> address >> job;
            sqlInput = "insert into iyoga(NAME, ADDRESS, JOB) values ('"
            + name + "','" + address + "','" + job + "')";
            char ch[100];
            strcpy(ch,sqlInput.c_str());
            //ch = sqlInput.c_str();
            db.AddMember(ch);
            //sql = "insert into iyoga(NAME, ADDRESS, JOB) values ('dd', 'b', 'c')";
        }
/*
        if (!commend.compare("add-card")) {
            cin >> type >> name >> type;
            sqlInput = "insert into iyoga(NAME, ADDRESS, JOB) values ('"
            + name + "','" + address + "','" + job + "')";
            char ch[100];
            strcpy(ch,sqlInput.c_str());
            //ch = sqlInput.c_str();
            db.AddMember(ch);
            //sql = "insert into iyoga(NAME, ADDRESS, JOB) values ('dd', 'b', 'c')";
        }

*/
        db.ShowTable();
    }

    cin.get();

    return 0;
}
